package com.example.chatrecycle.viewmodel;

import androidx.databinding.ObservableField;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import com.example.chatrecycle.model.MsgEntity;

import java.util.ArrayList;
import java.util.List;

public class ChatMessageItemViewModel {

    private ObservableField<List<MsgEntity>> msgs;

//    private MutableLiveData<List<MsgEntity>> msgs_m;

    public ChatMessageItemViewModel() {
        MsgEntity m1 = new MsgEntity(0, "one");
        MsgEntity m2 = new MsgEntity(0, "two");
        MsgEntity m3 = new MsgEntity(1, "three");
        List<MsgEntity> ms = new ArrayList<>();
        ms.add(m1);
        ms.add(m2);
        ms.add(m3);

        msgs = new ObservableField<>();
        msgs.set(ms);
        //msgs_m.setValue(ms);
    }

    public ObservableField<List<MsgEntity>> getMsgs() {
        return msgs;
    }

    public void setMsgs(ObservableField<List<MsgEntity>> msgs) {
        this.msgs = msgs;
    }
}
